<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>

<!--  学科组列表 -->
<!-- 
    修改人：   
    修改原因:改成遮罩形式。
    修改时间：2010-7-27
            
 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
		<title>学科组</title>
	<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
	<script src="<%=path%>/js/syAjax.js" type="text/javascript"></script>
	<script type="text/javascript">
	var objectTD="";
	var orgId;
	var objectHIDDENID;
	function giveParamArr(){
		return document.getElementById("tempIframe").contentWindow.giveParamArr();
	}
	
	/**选人div拖拽效果*/
	 window.onload=function() {
	 	resizeIframe();
		new Anim.DD($("items"), $("title"));
		$("items").style.left = "150px";
		$("items").style.top = "50px";
		new Anim.DD($("tempDiv"), $("temptitle"));
		$("tempDiv").style.left = "150px";
		$("tempDiv").style.top = "50px";
		
	};
      //显示遮罩
      function displayModuleDiv(){
		document.getElementById("items").style.display = "";	
		resizeIframe();
	}
	
	function displayModuleDiv2(url){
    	document.getElementById("selectUserIframe").src=url;
		document.getElementById("items").style.display = "";	
		resizeIframe();
		

	}
	
	//关闭div
	function closeDIV(){
		document.getElementById("items").style.display = "none";
	}
	
	function showModel(roleId){
		objectTD="";
        orgId=roleId;
        objectHIDDENID="p"+orgId;
		document.getElementById("selectUserIframe").src="<%=path%>/toSelectTeacherorganizationAction.action?years=${applicationScope.currentYear}&role.roleId="+roleId+"&actionURL=doChangeRoleUserorganizationAction.action&ttt="+new Date();
		displayModuleDiv();	
    }
    
	
      //影响透明度
	function resizeIframe(){
 		parent.resizeIframe();
 	}
 	
 	function doChooseUser(returnStr){
		document.getElementById("tempIframe").contentWindow.doChooseUser(returnStr);
		closeSelectDIV();
	}
 	
      function tdClick(url)
      {
        window.location.href=url;
      }
      
      function displayTempDiv(wth,hth){
		document.getElementById("tempDiv").style.height = hth+"px";
		document.getElementById("tempDiv").style.width = wth+"px";
		document.getElementById("tempDiv").style.display = "";	
		resizeIframe();
	}
	//关闭div
	function closeTempDiv(){
		document.getElementById("tempDiv").style.display = "none";
	}
	function closeSelectDIV(){
		document.getElementById("items").style.display = "none";
	}
	function refreshJsp(){
		window.location.href=window.location.href;
	}
       
      //显示遮罩
      function displayModuleDiv(url){
    	document.getElementById("selectUserIframe").src=url;
		document.getElementById("items").style.display = "";	

	}
	
      function addStaffRoom(){
     	document.getElementById("tempName").innerHTML="添加教研组";
        document.getElementById("tempIframe").src="<%=path %>/findCourseByParentCourseIdorganizationAction.action?t="+new Date();
        displayTempDiv(520,450);
	}
	
	function updateStaffRoom(src){
     	document.getElementById("tempName").innerHTML="修改教研组";
        document.getElementById("tempIframe").src=src+"&t="+new Date();
        displayTempDiv(530,450);
	}
	
	 //删除
      function deleteOrg(organizationId,orgType)
      {
        syAjax.request("post","<%=path %>/deleteByOrganizationIdorganizationAction.action?organization.organizationId="+organizationId+"&organization.orgType="+orgType+"&role.roleId=jyzz","",{success:initSuccessResult,fail:onFail,type:'plain'});
      }
      
      function initSuccessResult(response)
      {
        window.location.href=window.location.href;
      }
	</script>
  </head>
  
  <body>
  <div id="contentDIV" style="position:absolute;width:100%; padding:5px; background-color:#ffffff;z-index:1;">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" class="f_5">基本设置</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="left"><table  width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" background="<%=path %>/images/sywesp_24.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
           
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action');" style="cursor:pointer;">年级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table>
            </td>
             <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action?setGraduation=true');" style="cursor:pointer;">毕业年级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path%>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}');"" style="cursor:pointer;">班级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action');" style="cursor:pointer;">年度学期设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/findCourseByParentCourseIdCourseAction.action');" style="cursor:pointer;">学科设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_25.gif" class="f_9">教研组设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"><br></td>
              </tr>
            </table></td>
            <td width="75" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('findAllCodeMaintenanceTypeCodeMaintenanceAction.action');" style="cursor:pointer;">选项配置</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
             
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/baseSet/openClose.jsp');" style="cursor:pointer;">开关控制</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
              <td width="75" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/initMethodGraduationAndUpgradeAction.action');">毕业升级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="75" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/toClassSectionTimesListClassSectionTimesAction.action');">课时管理</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td align="left">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="tb_8 border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" align="right" bgcolor="#FFFFFF" nowrap="nowrap"><span class="f_5">&nbsp;</span>

                 <img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" />
                 <a href="javascript:addStaffRoom();">添加教研组</a>&nbsp;

               </td>
              </tr>
            <tr>
              <td height="30" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="2" height="24" align="left" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_20.gif" width="2" height="24" /></td>
                                <td align="left" background="<%=path %>/images/sywesp_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="1%">&nbsp;</td>
                                      <td width="5%" align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />序号</td>
                                      <td width="10%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />编号</td>
                                      <td width="20%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />名称</td>
                                      <td width="42%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />包含课程</td>
                                      <td width="16%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />教研组负责人</td>
                                      <td width="6%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />操作</td>
                                    </tr>
                                </table></td>
                                <td width="4" align="right" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_22.gif" width="4" height="24" /></td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td height="25" align="left" valign="top" class="tb_7">
                                 <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <c:choose>
                                      <c:when test="${! empty AllOrganizationByType}">
                                        <c:forEach items="${AllOrganizationByType}" var="org">
                                        <tr>
	                                      <td width="1%" align="right" valign="bottom">&nbsp;</td>
	                                      <td width="5%" height="25" align="left" valign="bottom">${org.sort }</td>
	                                      <td width="10%" align="left" valign="bottom">${org.organizationId }</td>
	                                      <td width="20%" valign="bottom">${org.name }</td> 
	                                      <td width="42%" valign="bottom" nowrap="nowrap">
	                                        <c:choose>
	                                          <c:when test="${! empty org.courses }">
	                                            <c:forEach items="${org.courses }" var="course">
	                                          		${course.name }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                                            </c:forEach>
	                                          </c:when>
	                                          <c:otherwise><font color="#CCCCCC">不包含课程</font></c:otherwise>
	                                        </c:choose>
	                                      </td>
	                                      <td width="16%" valign="bottom">
	                                        <c:set value="暂时没有负责人" var="noUser" scope="request"/>
	                                        <c:choose>    
	                                         <c:when test="${! empty org.userOrgRoleRelations }"> 
	                                         <c:forEach items="${org.userOrgRoleRelations }" var="pid">
	                                         	<c:if test="${ pid.id.role.roleId eq 'jyzz'}">
	                                         	   ${pid.id.user.name}<c:set value="" var="noUser"  scope="request" />
	                                         	</c:if>	
	                                         </c:forEach>
	                                         </c:when>
	                                        </c:choose>
	                                         <font color="#CCCCCC">${requestScope.noUser}</font>
	                                      </td>
	                                      <td width="6%" valign="bottom">
	                                        <a href="javascript:updateStaffRoom('<%=path %>/toUpdateStaffRoomorganizationAction.action?organization.organizationId='+encodeURIComponent('${org.organizationId }')+'&organization.orgType=${org.orgType }&role.roleId=jyzz')"><img src="<%=path %>/images/icon_5.gif" width="15" height="16" border="0" alt="编辑${org.name }" /></a> &nbsp;
	                                       
		                                      <a href="javascript:deleteOrg('${org.organizationId }','${org.orgType }');" onclick="return window.confirm('确定删除此学科组？')"><img src="<%=path %>/images/icon_11.gif" width="12" height="12" border="0" alt="删除${org.name }" /></a>

	                                      </td>
                                        </tr>
                                        </c:forEach>
                                      </c:when>
                                      <c:otherwise>
                                        <tr>
                                          <td colspan="6" align="center">暂无教研组信息</td>
                                        </tr>
                                      </c:otherwise>
                                    </c:choose>
                                </table></td>
                              </tr>
                            </table>
                             </td>
                        </tr>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="top" class="tb_9 border_3">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left"><img src="<%=path %>/images/icon_14.gif" width="62" height="17" /></td>
                </tr>
                <tr>
                  <td height="30" align="left" valign="bottom"><img src="<%=path %>/images/icon_5.gif" width="15" height="16" /> 表示修改当前教研组&nbsp;

                     <img src="<%=path %>/images/icon_11.gif" width="12" height="12" /> 表示删除当前教研组&nbsp; &nbsp;<img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" /> 表示添加教研组</td>

                </tr>
              </table></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
   <tr>
    <td colspan="2" align="left" valign="top" height="600">&nbsp;</td>
  </tr>
</table>
</div>

<div id="tempDiv" style="position: absolute; width: 0px;height:0px; top:100px; left:200px; padding-bottom:8px; background-color:#ECF7FD;z-index:8; border:3px solid #3A6EA5;display: none;" >
	<div style="width:100%;" id="temptitle">
		<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" bgcolor="#3A6EA5">
			<tr style=" height: 30px;">
				<td>&nbsp;&nbsp;<font color='#FFFFFF'><span id="tempName"></span>:</font></td>
				<td align="right"><a href="javascript:closeTempDiv();" style="text-decoration: none;"><span style="color: #000000; font-size:;">[关闭]</span></a></td>
			</tr>
		</table>
	</div>
	<div style="width:100%;top:100px;left:200px;height: 100%">
		<iframe name="tempIframe" id="tempIframe" src="" style="width:100%;height: 100%" align="middle"  frameborder="0"></iframe>   
	</div>
</div>

<div id="items" style="position: absolute; width: 730px;height:600px; top:100px; left:200px; padding-bottom:8px; background-color:#ECF7FD;z-index:10; border:3px solid #3A6EA5;display: none;" >
			<div style="width: 100%; top: 100px; left: 200px;" id="title">
				<table border="0" width="100%" cellpadding="0" cellspacing="0"
					align="center" bgcolor="#3A6EA5">
					<tr style="height: 30px;">
						<td>
							&nbsp;&nbsp;
							<font color='#FFFFFF'>请选择教师</font>
						</td>
						<td align="right">
							<a href="javascript:closeSelectDIV();" style="text-decoration: none;"><span
								style="color: #000000; font-size: ;">[关闭]</span>
							</a>
						</td>
					</tr>
				</table>
			</div>
			<div style="width: 100%; top: 100px; left: 200px; height: 100%">
				<iframe name="selectUserIframe" id="selectUserIframe" src=""
					style="width: 100%; height: 100%" align="middle" frameborder="0"></iframe>
			</div>
		</div>
  </body>
</html>
